package tk.winshu.argumentresolver.resovler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import tk.winshu.argumentresolver.service.IUserService;

import java.util.List;

/**
 * @author Kevin
 * @since 2019/6/10
 */
public class CurrentUserConfig implements WebMvcConfigurer {

    @Lazy
    @Autowired
    private IUserService userService;

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new CurrentUserResolver(userService));
    }
}
